<?php 

require '../dbconnect.php';
$query = "SELECT * FROM paymentplan;";
$result = mysql_query($query);

$json = "";
$first = true;
while($row = mysql_fetch_array($result)){
    if (!$first) { 
	    $json .=  ','; 
    } 
    else { 
    	$first = false; 
    }
    $json .= '"'.$row['name'].'"';
}
echo $json

?>